-
Notifications
You must be signed in to change notification settings - Fork 1.5k
win: symbol exports and minor fixes #3024
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
zcbenz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation generator does not seem to recognize the macro:
/home/runner/work/mlx/mlx/docs/src/cpp/ops.rst:6: WARNING: Error when parsing function declaration.
If the function has no return type:
Error in declarator or parameters-and-qualifiers
Invalid C++ declaration: Expecting "(" in parameters-and-qualifiers. [error at 8]
MLX_API array roll (const array &a, const Shape &shift, const std::vector< int > &axes, StreamOrDevice s={})
mlx/random.cpp
Outdated
| T f = T(1.0); | ||
| uint16_t* m = (uint16_t*)&f; | ||
| *m -= 1; | ||
| f.bits_ -= 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not work on mac:
/Users/runner/actions-runner/_work/mlx/mlx/mlx/random.cpp:92:4: error: member reference base type '__fp16' is not a structure or union
92 | f.bits_ -= 1;
| ~^~~~~~
/Users/runner/actions-runner/_work/mlx/mlx/mlx/random.cpp:128:22: note: in instantiation of function template specialization 'mlx::core::random::below_one<__fp16>' requested here
128 | return array(below_one<float16_t>(), float32);
| ^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find a good pattern for this one, so I backed it out. As a result, there's one known test failure:
C:\Users\danie\code\mlx\tests\random_tests.cpp(244):
TEST CASE: test random uniform
C:\Users\danie\code\mlx\tests\random_tests.cpp(368): ERROR: CHECK( abs(float(mean(out).item<bfloat16_t>()) - 0.5f) < 0.02 ) is NOT correct!
values: CHECK( 0.244141 < 0.02 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can reproduce this failure on Mac running CPP tests with CPU, and it is also failing on Windows. /cc @awni
|
Properly exporting public APIs on Windows requires adding a |
Also fixes DLL dependencies for test tools
01ce4ed to
395591d
Compare
zcbenz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks for putting this together!
We still need a few more reviews before merging though.
| set(target "${src_name}") | ||
| add_executable(${target} ${SRCFILE}) | ||
| target_link_libraries(${target} PRIVATE mlx) | ||
| # On Windows, copy the mlx DLL to the executable directory for runtime loading |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope there is a better solution but I'm good with what it is now. I have created a issue to track this: #3031.
Proposed changes
This PR extracts the non-CUDA portions of #2972 for Windows support.
Test results (known GGUF library incompatibility on Windows)
Checklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes